<template>
	<view class="item">
		<view class="item_content bg-white layout-margin-16" @click="getDetails">
			<view class="item-title">
				<u-tag v-if="objInfo.tag=='足球'" class="tag" :text="objInfo.tag" type="error" mode="light" size="mini" />
				<u-tag v-else class="tag" :text="objInfo.tag" mode="light" size="mini" />
				{{objInfo.title}}
			</view>
			<view class="item-info" v-for="(i,o) in objInfo.list" :key="o">
				<view>{{i.name}}</view>
				<view :class="i.type=='orange'?'orange-color':i.type=='black'?'black-color':''">{{i.value}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'item',
		data () {
			return {
				objInfo: {},
				payTypeMap: {
					1: '微信',
					2: '支付宝',
					3: '余额',
					4: '微信(第三方)',
					5: '支付宝(第三方)'
				}
			}
		},
		props: {
			info: {
				type: Object,
				default: () => ({})
			}
		},
		computed: {

		},
		methods: {
			// 跳转详情
			getDetails () {
				uni.navigateTo({
					url: `/pages/details/details?content_id=${this.info.content_id}&currentIndex=0&appid=${this.info.app_id}`
				})
			}
		},
		mounted () {
			this.objInfo = {
				tag: this.info.category_id==3?'足球':'篮球',
				title: this.info.title,
				list: [
					{name: '退款', value: `+￥${this.info.refund_money}`, type: 'orange'},
					{name: '退款原因', value: `${this.info.refund_reason}`},
					{name: '退款时间', value: this.info.refund_time}
				]
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "@/assets/css/user.scss";
	.item_content:active {
		background: rgba(0,0,0,0.1);
	}
</style>